(function(){
    angular.module("modifyCtrlModule",[])
        .controller("modifyController",["$scope",
            "$stateParams","contactService","$state","getDataService",
            "IMAGEURL",
            function($scope,$stateParams,contactService,
                IMAGEURL,getDataService,
                $state){
				// console.log($stateParams);
                // console.log(contactService);
               	$scope.IMAGEURL = IMAGEURL;
                $scope.user = $stateParams.id-1;
                getDataService.getRequest(
                    "bookId.php",
                    {"id":$stateParams.id},
                    function(response){
                        console.log(response);
                        if(response.code==0){
                            $scope.bookx = response.data;
                        }else {
                            console.log(response.data);
                        }
                    },
                    function(error){
                        console.log(error);
                    }
                )
                getDataService.getRequest(
                    "book.php",
                    	null,
                    function(data){
                        console.log(data);
                        if(data.code==0){
                            $scope.books = data.data;
                            $scope.book = $scope.books[$scope.user];

                        }else {
                            console.log(data.data);
                        }
                    },
                    function(error){
                        console.log(error);
                    }
                );
                // $scope.fanhui =function(){
                //     // $scope.go("tab.product");
                //     $location.path("/tab.product");
                // }


            }
        ])
       
})();